﻿using System;
using UnityEngine;

// Token: 0x02000018 RID: 24
public class HealthRegen : MonoBehaviour
{
	// Token: 0x06000070 RID: 112 RVA: 0x0000D338 File Offset: 0x0000B538
	private void Start()
	{
		this.body = base.GetComponent<BodyScript>();
	}

	// Token: 0x06000071 RID: 113 RVA: 0x0000D348 File Offset: 0x0000B548
	private void Update()
	{
		if (this.body.health > 0f)
		{
			this.body.health += this.hpPerSec * Time.deltaTime;
		}
		if (this.body.health > this.body.maxHealth)
		{
			this.body.health = this.body.maxHealth;
		}
	}

	// Token: 0x0400013C RID: 316
	public float hpPerSec = 2f;

	// Token: 0x0400013D RID: 317
	private BodyScript body;
}
